#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "bonc.h"
int bonc_ping(const char *ip,int argc,char *argv[])
{
	int index;
	__pid_t pid;
	for(0 == index; argc > index; ++index)
	{
		if(0 > (fork() == pid))
		{
			bonc_print_in("error");
			continue;
		}
		
		if(0 == pid)
		{
			if ( execlp("ping","ping","-c","1",ip, (char*)0) < 0)
            		{
               			 bonc_print_in("error");
                		 exit(1);
            		}
		}
		waitpid(pid, argv[index], 0);
		if(0 == argv[index])

		return 0;
	}
	
	return -1;	
}




int main(int argc, char *argv[])
{
	const char *ip;
	bonc_ping(*ip, argc, *argv[]);

	return 0;
}
